docs(spec): record DeleteDataRequestSchema's consumer and why the DELETE data door carries no requestSchema - #16191
Conversation
…ETE data door carries no requestSchema The docblock above `DeleteDataRequestSchema` in `packages/spec/src/api/protocol.zod.ts` was bare. It now records three verified facts for the next reader who greps the name and sees "exported, documented, zero safeParse call sites": the schema is the request contract of `DataProtocol.deleteData()` (consumed statically via the `DeleteDataRequest` alias); it deliberately carries no REST-door `requestSchema` under #3899, which the catalog entry states in place of the key and `plugin-rest-api.schema-refs.test.ts` pins ("requestSchema appears only on body-carrying methods"); and drift between the schema and that door is caught at compile time by the typed request literal `ServerScopedDataRequest` in `packages/rest/src/rest-server.ts` (#15866), not by a runtime parse. Comment and changeset only — no shape, `.describe()`, or export change; no other `*RequestSchema` docblock is touched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
📓 Docs Drift CheckThis PR changes 1 package(s): 11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 130 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 07ce8245635def0b8bdb88c733bba355246b9a83 && git checkout 07ce8245635def0b8bdb88c733bba355246b9a83
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 53cf263eb66526474813d623bdcde7fd1de957a7 bbb1e81615dffc182754da7a2c763175e9881314 && git checkout -B drift-repro 53cf263eb66526474813d623bdcde7fd1de957a7 && git merge --no-ff bbb1e81615dffc182754da7a2c763175e9881314
node scripts/docs-audit/affected-docs.mjs --json 53cf263eb66526474813d623bdcde7fd1de957a7
|
Fixes #13852
What
One docblock and one changeset. The bare
/** Delete Data Request */header aboveDeleteDataRequestSchemainpackages/spec/src/api/protocol.zod.tsnow records the three facts triage's 2026-09-06 ruling (comment 5556446972) asked for. Each was verified onorigin/mainatd5d8d50db(this PR's base) before being written:DataProtocol.deleteData()(protocol.zod.ts:3354on the base; theDeleteDataRequestalias at:3182). It is consumed statically and parsed at runtime nowhere in the tree — the grep that sees "exported, documented, zerosafeParsecall sites" is reading the wrong surface, and this card is that grep's filing.requestSchema, per 请求体从不与声明它的 schema 对照(#3877 的请求侧对偶):7 个 schema 定义了从未启用,而 API 目录已宣称生效 #3899. The catalog's DELETE entry states it in place of the key (plugin-rest-api.zod.ts:1029-1030), andplugin-rest-api.schema-refs.test.ts:77pins it ("requestSchema appears only on body-carrying methods (POST/PUT/PATCH)"). Read against the real handler (packages/rest/src/rest-server.ts:8558-8591):objectandidcome fromreq.params,expectedVersionfromreq.queryor theIf-Matchheader, andreq.bodyis never read.p.deleteData({...} as any)/p.updateData({...} as any)erase the compile-time check of the assembled request againstDeleteDataRequest/UpdateDataRequest#15866, landed by PR fix(rest): compile the data doors' protocol requests against the declared contract #16071 (merged;9b459b791is on the base). The door's literal isconst deleteRequest: ServerScopedDataRequest OF DeleteDataRequest = { ... }(rest-server.ts:8584, generic spelled out for the sanitizer), handed top.deleteData(deleteRequest)with no cast; theServerScopedDataRequestdocblock (:228-262) states the guard, so the new note points at it rather than duplicating it.Scope, exactly as ruled: no
requestSchemaadded to any route; the schema is not retired; no other*RequestSchemadocblock is touched; no shape,.describe(), or export change. Clause ②: no — the diff is a comment and a changeset; it sits underpackages/spec/src/**only because that is where the declaration lives.Ruling text, verbatim:
Does the docblock project anywhere?
content/docs/references/api/protocol.mdx: no. The generator renders.describe()strings and the module-level file header, not per-schema docblocks — control: the siblingUpdateDataRequestSchemaprose "Modification of an existing record" occurs 0 times in the page.check:docson the rebuilt tree is green.declaration-map/,api-surface/,export-origins/: name-to-anchor and export maps, no line numbers and no doc text;check:generatedreports all 15 artifacts up to date.dist/api/index.d.ts(and.d.mts) directly abovedeclare const DeleteDataRequestSchema(control: the[#3939]docblock onUpdateManyDataRequestSchemaships the same way), andspecpublishessrc/**/*.zod.tsdirectly via itsfilesentry. Hence thepatchchangeset, marked documentation-only, following the precedent ofd5d8d50db.Verification
All on
bbb1e8161; exit codes captured before any pipe; heavy runs throughscripts/pm/os-verify-lock.shwith the VERDICT line read.pnpm --filter @objectstack/spec build—VERDICT command-exit 0(held 152s).pnpm --filter @objectstack/spec check:generated— exit 0, "All 15 generated artifacts are up to date."pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/api/plugin-rest-api.schema-refs.test.ts src/api/protocol.test.ts src/type-alias-convention.pin.test.ts—VERDICT command-exit 0,Test Files 3 passed (3),Tests 185 passed (185).pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/api—VERDICT command-exit 0,Test Files 41 passed (41),Tests 1380 passed (1380).pnpm --filter @objectstack/spec typecheck(tsc --noEmit,check:scripts-typecheck,check:test-typecheck) —VERDICT command-exit 0.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandsderived 67 families off the real diff (2 paths vs merge based5d8d50db); every one was run and recorded, and--ranreconciles "67 derived, 67 run, 0 NOT-MEASURED, 0 UNRUN". 65 exited 0. Two exited 3 =PREREQUISITE NOT MET, nothing measured:check:doc-formula-expressionsneeded@objectstack/formulaand@objectstack/lintbuilt — built under the lock (VERDICT command-exit 0), re-run exit 0;check:dual-build-cjs-loadsneeds every package'sdist/(86 missing here) and has no package-scope flag — NOT MEASURED locally, CI-owned. Six further families the residue lists take a value from the workflow ($RUNNER_TEMP, matrix shards) and have no local invocation by design.pnpm exec eslint --no-inline-config --format json packages/spec/src/api/protocol.zod.ts— 1 file, 0 errors, 0 warnings (eslint v10.8.1). Population read from eslint's own config: the changeset.mdreports "File ignored because no matching configuration was supplied", so the diff's lintable population is exactly that one file. Invariance:eslint.config.mjs(around line 326) states the repo "never enables type-aware linting (noparserOptions.project, no typed@typescript-eslintrules) for ANY file", so a comment-only diff cannot move an untouched file's verdict.git status --porcelainclean after every gate; control-byte scan (grep -naP) of the diff hunk: 0 hits;check:nul-bytesexit 0.Declared narrowing
turbo ls --affectedagainst BASE lists 75 of 78 workspace packages — every package sits downstream ofspec. Locally I ran spec's owntypecheck, itssrc/apidirectory (41 files) and the three pins that read this schema; the remaining spec test files and all downstream packages' suites are declared to CI (Test Core,TypeScript Type Check). Reasoning: the diff is a comment inside alazySchemadocblock plus a changeset; nothing pins its line numbers (scripts/adr-anchors/,packages/spec/liveness,declaration-mapall checked), and every artifact gate that reads the file is green.Not done, on purpose
p.deleteData({...} as any)/p.updateData({...} as any)erase the compile-time check of the assembled request againstDeleteDataRequest/UpdateDataRequest#15866 is not addressed here — it already landed via PR fix(rest): compile the data doors' protocol requests against the declared contract #16071; the note only points at it. 请求体从不与声明它的 schema 对照(#3877 的请求侧对偶):7 个 schema 定义了从未启用,而 API 目录已宣称生效 #3899 is not addressed here — it is the decision the note records.packages/rest的其它req.query.*读取点同样把string | string[]当字符串用(#6307 的未扩大部分) #6877 is not addressed here — it is cited from the handler's own comment.deleteDataoccurs in 9 non-test files across 6 package directories, 19 occurrences (git grep -landgit grep -ooverpackages/**/src/**, test files and test directories excluded). The cli seat's 23/11 and triage's 12/7 were taken with other scopes; none of the three numbers is written into the docblock, which names the consumer and not a count.:8584and the absence of any cast at the sevenp.deleteData/p.updateDatadispatch sites — not by a mutation experiment, which would need the@objectstack/resttypecheck closure built.Generated by Claude Code